home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / viewkit / xcontact / include / CardInfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  3.2 KB  |  111 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. ////////////////////////////////////////////////////////////////
  18. // CardInfo.h --
  19. ////////////////////////////////////////////////////////////////
  20. #ifndef CARDINFO_H
  21. #define CARDINFO_H
  22.  
  23. #include "Attributes.h"
  24.  
  25. #include "OkStr.h"
  26. #include "Database.h"
  27.  
  28. class CardInfo : public Persistent {
  29.  
  30.  public:
  31.   CardInfo( ObjAddr obj );
  32.   CardInfo( const char* name=NULL, ObjAddr obj=NULL );
  33.   ~CardInfo();
  34.   void save();
  35.  
  36.   Boolean containString( OkStr s, 
  37.              Boolean caseSensitive=FALSE,
  38.              Boolean srchNotesToo=FALSE );
  39.   static Boolean ContainString( OkStr s, OkStr target, 
  40.             Boolean caseSensitive=FALSE );
  41.  
  42.   // Access funcs.
  43.   OkStr name() const                 { return _name; }
  44.   OkStr phone1() const                 { return _phone1; }
  45.   OkStr phone2() const                 { return _phone2; }
  46.   OkStr fax() const                 { return _fax; }
  47.   OkStr mobilePhone() const            { return _mobilePhone; }
  48.   OkStr email() const                 { return _email; }
  49.  
  50.   OkStr addressLine1() const            { return _addressLine1; }
  51.   OkStr addressLine2() const            { return _addressLine2; }
  52.   OkStr city() const                 { return _city; }
  53.   OkStr state() const                 { return _state; }
  54.   OkStr zip() const                 { return _zip; }
  55.   OkStr country() const             { return _country; }
  56.  
  57.   Boolean attribute( int i ) const         { return _attribute[ i ]; }
  58.  
  59.   OkStr notes() const                { return _notes; }
  60.  
  61.  
  62.   void setName( OkStr name )            { _name = name; }
  63.   void setPhone1( OkStr phone1 )        { _phone1 = phone1; }
  64.   void setPhone2( OkStr phone2 )        { _phone2 = phone2; }
  65.   void setFax( OkStr fax )            { _fax = fax; }
  66.   void setMobilePhone( OkStr mobilePhone )     { _mobilePhone = mobilePhone; }
  67.   void setEmail( OkStr email )            { _email = email; }
  68.  
  69.   void setAddressLine1( OkStr ln1 )        { _addressLine1 = ln1; }
  70.   void setAddressLine2( OkStr ln2 )        { _addressLine2 = ln2; }
  71.   void setCity( OkStr city )            { _city = city; }
  72.   void setState( OkStr state )            { _state = state; }
  73.   void setZip( OkStr zip )            { _zip = zip; }
  74.   void setCountry( OkStr country )        { _country = country; }
  75.  
  76.   void setAttribute( int i, Boolean b )        { _attribute[ i ] = b; }
  77.  
  78.   void setNotes( const char* notes )        { _notes = notes; }
  79.  
  80.  
  81.  protected:
  82.   // Persistent funcs.
  83.   void Read();
  84.   void Write();
  85.  
  86.  private:
  87.  
  88.   OkStr        _name;
  89.   OkStr        _phone1;
  90.   OkStr        _phone2;
  91.   OkStr        _fax;
  92.   OkStr        _mobilePhone;
  93.   OkStr        _email;
  94.  
  95.   OkStr        _addressLine1;
  96.   OkStr        _addressLine2;
  97.   OkStr        _city;
  98.   OkStr        _state;
  99.   OkStr        _zip;
  100.   OkStr        _country;
  101.  
  102.   Boolean    _attribute[ ATTR_COUNT ];
  103.  
  104.   OkStr        _notes;
  105.  
  106.   void init( const char* name, ObjAddr obj );
  107.  
  108. };
  109.  
  110. #endif
  111.